﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>首页</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<link rel="stylesheet" href="<%=path%>/statics/css/reset.css">
	<link rel="stylesheet" href="<%=path%>/statics/css/index.css">
	<script src="<%=path%>/statics/js/yzs_index.js"></script>
	<script src="<%=path%>/statics/js/rem.js"></script>
<link href="<%=path%>/statics/iconfont/iconfont.css" rel="stylesheet">
<link href="<%=path%>/statics/css/mui.min.css" rel="stylesheet">
<link href="<%=path%>/statics/css/all.css" rel="stylesheet">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/statics/css/base.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/statics/css/style.css" />
</head>
<body>
 <script type="text/javascript">
        function getRTime(){
            var NowTime = new Date();
            var y_num = NowTime.getFullYear();
            var m_num = NowTime.getMonth();
            var d_num = NowTime.getDate();
            var EndTime= new Date(y_num,m_num,d_num+1); //截止时间 前端路上 http://www.51xuediannao.com/qd63/
            var t =EndTime.getTime() - NowTime.getTime();

            var d=Math.floor(t/1000/60/60/24);
            var h=Math.floor(t/1000/60/60%24);
            var m=Math.floor(t/1000/60%60);
            var s=Math.floor(t/1000%60);

          
            document.getElementById("t_h").innerHTML = h + "";
            document.getElementById("t_m").innerHTML = m + "";
            document.getElementById("t_s").innerHTML = s + "";
           
        }
        setInterval(getRTime,1000);
    </script>
<c:if test="${myList==null }">
			<%response.sendRedirect("index.html"); %>
			</c:if>
	<!-- 最外层容器 -->
	<div class="jd_container">
		<!-- 顶部 -->
		<header class="mui-bar mui-bar-nav" id="header">
		<div class="top-sch-box flex-col">
			<div class="centerflex">
				<i class="fdj iconfont "><img src="<%=path%>/statics/images/sousuo.png"></i>
				<div class="sch-txt" >连衣裙就是你的女人味儿</div>
				<span class="shaomiao"><i class="iconfont "></i></span>
			</div>
			 <img src="<%=path%>/statics/images/i-cart-active.png" onclick="location.href='<%=path %>/trolley/sys/shopcar.html'" style="width: 12%; margin-left:8.8rem ;margin-top:-3rem ;    margin-bottom: 0.65rem;">
		</div>
		
		<a class="btn" > <i class="iconfont "></i>
		</a> <a class="btn" > <i class="iconfont "></i>
		</a>
	</header>
		<div class="pop-schwrap">
			<div class="ui-scrollview">
				<div class="mui-bar mui-bar-nav clone">
					<a class="btn btn-back" href="javascript:;"></a>
					<div class="top-sch-box flex-col">
						<div class="centerflex">
							<input class="sch-input mui-input-clear" type="text" name="productName"
								id="nr" placeholder="连衣裙就是你的女人味儿"  />
						</div>
					</div>
					
					<a class="mui-btn mui-btn-primary sch-submit"
						 id="suress" onclick="look()">搜索</a>
				 </div>
				<div class="scroll-wrap">
					<div class="mui-scroll">
						<div class="sch-cont">
							<div class="section ui-border-b">
								<div class="tit">
									<i class="iconfont "></i>热门搜索
								</div>
								<div class="tags">
								<c:forEach var="hot" items="${hotList }">
									<a href="<%=path %>/product/ription.html?nr=${hot.name }" class="tag">${hot.name }</a>
								</c:forEach>
								</div>
							</div>
							<div class="section">
								<div class="tit">
									<i class="iconfont "></i>最近搜索
								</div>
								<div class="tags" id="ylh">
								
								</div>
							</div>
						</div>
						<div class="sch-clear" >
							<a href="javascript:void" onclick="shan()"><i class="iconfont " ></i>清除搜索历史</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	<div class="mui-content">
        <div class="banner swiper-container">
            <div class="swiper-wrapper">
            	<c:forEach var="img" items="${pList }">
            		 <div class="swiper-slide"><a href="javascript:void(0)"><img height="150"  class="swiper-lazy"  data-src="<%=path %>/statics/images/${img.file }" alt=""></a></div>
            	</c:forEach>
            </div>
            <div class="swiper-pagination"></div>
        </div>
           </div>
		<!-- 轮播图 -->
		<div class="jd_banner">
			
		</div>
		<!-- 导航栏 -->
		
		
		<div class="jd_mian">
			<div class="main_content">
				<div class="content_top">
					<a href="" class="seck-left">
						<img src="<%=path%>/statics/images/miaosha.png" alt="" width="69" height="27">
						<strong>16点场</strong>
						<div class="seck_timer">
							<div class="seck_time hour">
							 
                <span id="t_h">4</span>
           
            
							</div>
							<span class="time-space">:</span>
							<div class="seck_time minute">
							  <span id="t_m">56</span>
								
							</div>
							<span class="time-space">:</span>
							<div class="seck_time second">
							    <span id="t_s">55</span>
								
							</div>
						</div>
					</a>
					<a href="" class="seck-right">
						两个小时要你一次
						<i class="icon">></i>
					</a>
				</div>
				<div class="content_bottom">
					<ul class="seckul clearfix">
						
						<c:forEach items="${myList }" var="item">
						<li class="seck_list">
							<div class="goods_img">
								<a href="<%=path %>/product/detail/${item.id}">
									<img src="<%=path%>/statics/files/${item.fileName}" alt="">
								</a>
								<span class="bg1">${item.name}</span>
							</div>
							<div class="goods_price">
								<span class="now_price">
									<em>¥</em>${item.price}
								</span>
								<span class="old_price">
									<em>¥</em>${item.yuanprice}
								</span>
							</div>
						</li>
						</c:forEach>
						
						
					</ul>
				</div>
				<div class="super_day">
					<div class="super_img">
						<a href="">
							<img src="<%=path%>/statics/images/superday.jpg" alt="" width="100%">
						</a>
					</div>
					
			
 <iframe src="<%=path %>/refindex.html" width="100%" height="3250" frameborder="0" seamless="seamless" scrolling="no">
  
  
  
</iframe> 
						
						
					</div>
				</div>
				
			
		</div>
	</div>

	<footer class="page-footer fixed-footer" id="footer">
		<ul>
			<li class="active"><a href="index.html"> <img
					src="statics/images/footer01.png" />
					<p>首页</p>
			</a></li>
			<li><a href="<%=path %>/type/assort"> <img
					src="statics/images/footer002.png" />
					<p>分类</p>
			</a></li>
			<li><a href="<%=path %>/trolley/sys/shopcar.html"> <img
					src="statics/images/footer003.png" />
					<p>购物车</p>
			</a></li>
			<li><a href="user/sys/self.html"> <img
					src="statics/images/footer004.png" />
					<p>个人中心</p>
			</a></li>
		</ul>
	</footer>

</body>
<script type="text/javascript" src="<%=path %>/statics/js/jquery-1.8.3.min.js"></script>
<script src="statics/js/fastclick.js"></script>
<script src="statics/js/mui.min.js"></script>
<script type="text/javascript" src="statics/js/hmt.js"></script>
<!--插件-->
<link rel="stylesheet" href="statics/js/swiper/swiper.min.css">
<script src="statics/js/swiper/swiper.jquery.min.js"></script>
<!--插件-->
<script src="statics/js/global.js"></script>
<script>
	var s=localStorage.length;
	$(function(){
		var banner = new Swiper('.banner', {
			autoplay : 5000,
			pagination : '.swiper-pagination',
			paginationClickable : true,
			lazyLoading : true,
			loop : true
		});

		mui('.pop-schwrap .sch-input').input();
		var deceleration = mui.os.ios ? 0.003 : 0.0009;
		mui('.pop-schwrap .scroll-wrap').scroll({
			bounce : true,
			indicators : true,
			deceleration : deceleration
		});
		$('.top-sch-box .fdj,.top-sch-box .sch-txt,.pop-schwrap .btn-back').on(
				'click', function() {
					$('html,body').toggleClass('holding');
					$('.pop-schwrap').toggleClass('on');
					if ($('.pop-schwrap').hasClass('on')) {
						;
						$('.pop-schwrap .sch-input').focus();
					}
		});
	});
	//获取当前根目录
	 function getRootPath(){
		    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
		    var curWwwPath=window.document.location.href;
		    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
		    var pathName=window.document.location.pathname;
		    var pos=curWwwPath.indexOf(pathName);
		    //获取主机地址，如： http://localhost:8083
		    var localhostPaht=curWwwPath.substring(0,pos);
		    //获取带"/"的项目名，如：/uimcardprj
		    var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
		    return(localhostPaht+projectName);
		}
	 
	function look(){
		var nr=$("#nr").val();
		 if(nr==""){
			location.href=getRootPath()+"/product/ription.html?nr=女";
		}else{
			suo(nr);
			s=s+1;
			location.href=getRootPath()+"/product/ription.html?nr="+nr;
		};
	}
	function suo(nr){
		var num=0;
		if(localStorage.length>0){
		for(var i=0;i<localStorage.length;i++){
			if(nr==localStorage.getItem("s"+i)){
				num=1;
				break;
			}
		}
		if(num==0){
			localStorage.setItem("s"+s,nr);
			tian();
		}
		}else{
			localStorage.setItem("s"+s,nr);
			tian();
		}
	}
	function tian(){  //添加一条记录

			var dd=$("<a href='<%=path %>/product/ription.html?nr="+localStorage.getItem('s'+s)+"' class='tag'>"+localStorage.getItem('s'+s)+"</a>");
			$("#ylh").prepend(dd);
		
	}
	function shan(){    //删除历史记录
		var flag=confirm("确定要清空吗？");
    	if(flag){ 
    		s=0;
    		localStorage.clear();
    		$("#ylh").children().remove();
    	}
		
	}
	 $(document).ready(function(){    // 页面加载是显示历史记录
		 for(var i=0;i<localStorage.length;i++){
				var dd=$("<a href='<%=path%>/product/ription.html?nr="+localStorage.getItem('s'+i)+"' class='tag'>"+localStorage.getItem('s'+i)+"</a>");
				$("#ylh").prepend(dd);
			}
	 });
</script>
</html>
